package xyz.app;

import org.springframework.context.annotation.Configuration;
import xyz.app.domain.accounts.DaoCorrespondent;
import xyz.app.domain.addresses.DaoAddress;
import xyz.app.domain.addresses.DaoLegalAddress;
import xyz.app.domain.parties.DaoParty;
import xyz.app.domain.parties.businessregistrations.DaoBusinessRegistration;
import xyz.app.domain.parties.names.DaoName;
import xyz.app.domain.roles.DaoBank;
import xyz.app.domain.roles.DaoBranch;
import xyz.app.domain.roles.DaoParent;

import java.util.Set;

@Configuration
public class DaoConfiguration {

    DaoConfiguration(DaoRegistry daoRegistry,

                     DaoParty daoParty,
                     DaoName daoName,
                     DaoBusinessRegistration daoBusinessRegistration,

                     DaoAddress daoAddress,
                     DaoLegalAddress daoLegalAddress,

                     DaoCorrespondent daoCorrespondent,

                     DaoBank daoBank,
                     DaoBranch daoBranch,
                     DaoParent daoParent) {

        Set.of(
                        daoParty,
                        daoName,
                        daoBusinessRegistration,
                        daoAddress,
                        daoLegalAddress,
                        daoCorrespondent,
                        daoBank,
                        daoBranch,
                        daoParent
                )
                .forEach(daoRegistry::addDao);
    }
}